<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>组件的抽离2</title>
</head>
<body>
<div id="app">

  <cpn2></cpn2>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<template id="cpns"><div>
  <h2>局部</h2>
  <p>内容一</p>
  <p>内容二</p>
</div></template>
<script>

  const app = new Vue({
    el: "#app",
    components: {
      //局部组件的语法糖
      'cpn2': {
        template:'#cpns'
      }
    }
  })

</script>
</body>
</html>
